package com.pmcc.core.web;

import com.pmcc.core.entity.Answer;
import com.pmcc.core.service.AnswerService;
import com.pmcc.utils.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by spurs on 2018/11/15.
 */
@RestController()
@RequestMapping("api/v1/answer")
@Api(value = "AnswerController", description = "密保答案")
public class AnswerController {
    @Autowired
    AnswerService answerService;

    @PostMapping("/saveAnswer")
    public ResultBean saveAnswer(@RequestBody  Answer answer){
        return answerService.saveAnswer(answer);
    }
    /**
     * 查询密保问题
     */
    @ApiOperation(value = "employeeId", httpMethod="GET", notes = "查询密保问题", response = ResultBean.class)
    @GetMapping("queryAnswer")
    public ResultBean queryAnswer(@ApiParam(required =true, name ="查询密保问题", value ="employeeId")String employeeId) {
        return answerService.queryAnswer(employeeId);
    }

}
